# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=more-itertools
pkgbase=python2-${_realname}
pkgname=("python2-${_realname}")
pkgver=5.0.0
pkgrel=2
pkgdesc='More routines for operating on iterables, beyond itertools'
arch=('any')
url='https://github.com/erikrose/more-itertools'
#url='https://pypi.python.org/pypi/more-itertools'
license=('MIT')
makedepends=('python2-setuptools' 'python2-six')
depends=('python2' 'python2-six')
source=("https://files.pythonhosted.org/packages/source/m/more-itertools/more-itertools-$pkgver.tar.gz")
sha512sums=('f72c8d6c75799c39708443ba75862801ddd3fc0382c9eee7ed24ecf04cbc7d9ff6a8e35b6fff1eaccf45ddd470c2cc8959532eca32c2ff50b0a12588727c68b4')

prepare() {
  cd "${srcdir}"
  local builddir="python2-build-${CARCH}"
  rm -rf ${builddir} | true
  cp -r "${_realname}-${pkgver}" "${builddir}"
  # Set version for setuptools_scm
  export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
}

build() {
  msg "Python 2 build for ${CARCH}"  
  cd "${srcdir}/python2-build-${CARCH}"
  python2 setup.py build
}

package() {
  cd "${srcdir}/python2-build-${CARCH}"
  python2 setup.py install --root="$pkgdir/" --optimize=0 --skip-build
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
